package setupapplication.logic;

import getattacktype.core.AttackRunner;
import geturl.core.UrlRunner;
import setupapplication.data.UserSettings;

public class SetUserData implements Setupable_Interface {

	@Override
	public UserSettings setupData(UserSettings userSettings, String decision) {
		switch(decision){
			
			case "add url":
				
				String url = getUrl();
				userSettings.setUrl(url);
				
				break;
			
			case "add parameters":
				break;
			
			case "set type to attack":
				String attackType = getAtackType();
				userSettings.setAttackType(attackType);
				break;
				
			case "select file type":
				break;
			
			case "additional features":
				break;
			
			case "exit":
				
				return null;
			
			default:
				
				return null;
		
		}
		
		return userSettings;
	}

	private String getAtackType() {
		
		AttackRunner attackRunner = new AttackRunner();
		
		String attackType = attackRunner.run();
		
		return attackType;
	
	}

	private String getUrl() {
		
		UrlRunner urlRunner = new UrlRunner();
		
		String url = urlRunner.run();
		
		return url;
	
	}

}
